<template>
  <div class="setting">
    <div class="top">
      <img src="@/assets/images/pc-zysz-bg.png" alt="setting" />
      考生志愿填报方式、时间和办法由各省级招委会根据本地区招生工作实际作出具体规定并向社会公布。具体志愿设置情况以考生本省招生规定公布为准。
    </div>
    <div class="title-box">
      <div class="title">{{ currentYear }}年高考填报志愿时间及方式汇总</div>
      <div class="desc">
        <img src="@/assets/svg/trumpet.svg" alt="setting" />
        <span>陆续更新，敬请期待……</span>
      </div>
    </div>
    <div class="table">
      <div class="table-header">
        <div class="table-header-item">省市</div>
        <div class="table-header-item">填报志愿时间</div>
        <div class="table-header-item">志愿设置</div>
      </div>
      <div class="table-body">
        <div
          class="table-body-item"
          v-for="item in tableList"
          :key="item.state"
        >
          <div class="table-body-item-state">{{ item.state }}</div>
          <div class="table-body-item-time">{{ item.time }}</div>
          <div class="table-body-item-setting">{{ item.setting }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { settingList } from '@/utils/guide';

const currentYear = ref(new Date().getFullYear());

const tableList = ref(settingList);

onMounted(() => {});
</script>

<style scoped lang="scss">
.setting {
  .top {
    position: relative;
    padding: 24px 24px 24px 150px;
    background-color: #d6e7ff;
    color: #666;
    font-size: 26px;
    line-height: 1.8;
    img {
      position: absolute;
      left: 24px;
      top: -24px;
      width: 100px;
      height: auto;
    }
  }
  .title-box {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 24px 0;
    .title {
      font-size: 30px;
      font-weight: bold;
    }
    .desc {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 12px;
      font-size: 24px;
      color: #666;
      img {
        width: 24px;
        margin-right: 12px;
      }
    }
  }
  .table {
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    overflow: hidden;
    font-size: 26px;
    line-height: 1.8;
    color: #444;
    .table-header,
    .table-body-item {
      display: flex;
    }
    .table-header {
      background: #f5f5f5;
      font-weight: bold;
    }
    .table-header-item,
    .table-body-item-state,
    .table-body-item-time,
    .table-body-item-setting {
      box-sizing: border-box;
      padding: 12px;
      text-align: center;
      border-right: 1px solid #d9d9d9;
      border-bottom: 1px solid #d9d9d9;
      min-height: 48px;
      display: flex;
      align-items: center;
      text-align: left;
      line-height: 1.6;
    }
    // 第一列宽度10%，右边框
    .table-header-item:first-child,
    .table-body-item-state {
      width: 10%;
      min-width: 80px;
      max-width: 120px;
      flex: none;
      border-right: 1px solid #d9d9d9;
    }
    // 第二、三列平均分
    .table-header-item:nth-child(2),
    .table-header-item:nth-child(3),
    .table-body-item-time,
    .table-body-item-setting {
      width: 45%;
      flex: none;
    }
    // 最后一列不显示右边框
    .table-header-item:last-child,
    .table-body-item-setting {
      border-right: none;
    }
    // 最后一行不显示下边框
    .table-body-item:last-child > .table-body-item-state,
    .table-body-item:last-child > .table-body-item-time,
    .table-body-item:last-child > .table-body-item-setting {
      border-bottom: none;
    }
    .table-body-item-state {
      text-align: center;
    }
  }
}
</style>
